package part1;

/**
 * <p>Title: Project 8 part 1</p>
 * <p>Description: CS 235 Project #8 pt. 1
 *       Shows how to get started with using interfaces.</p>
 * @author Anthony Varghese
 * @date   February 5th 2014
 * @version 1.0
 */


interface Player {
	public abstract String name();
	public abstract int sticksTaken();
	public abstract void takeTurn(Pile pile, int maxOnATurn);
	public static final int MAX = 100;
}

/**
 * The Classes Pile and Game are from Ch. 8 of Nino & Hosch
 */
class Pile { }
class Game {
	private Player player1, player2;
	private Player nextPlayer;
	public Game( Player p1, Player p2){ nextPlayer = player1 = p1; player2 = p2;}
	/* take turns every time the nextPlayer method is called */
	public Player nextPlayer(){ return nextPlayer = (nextPlayer == player1) ? player2 : player1; } 
}


/**
 * The Classes TimidPlayer, GreedyPlayer, and CleverPlayer are from Ch. 9 of Nino & Hosch
 */
class TimidPlayer implements Player {
	private String name;
	public TimidPlayer(String n){ name = n; }
	public String name () { return name; }
	public int sticksTaken (){ return 0; }
	public void takeTurn (Pile pile, int maxOnATurn){ }
}

class GreedyPlayer implements Player {
	private String name;
	public GreedyPlayer(String n){ name = n; }
	public String name () { return name; }
	public int sticksTaken (){ return 0; }
	public void takeTurn (Pile pile, int maxOnATurn){ }
}

class CleverPlayer implements Player {
	private String name;
	public CleverPlayer(String n){ name = n; }
	public String name () { return name; }
	public int sticksTaken (){ return 0; }
	public void takeTurn (Pile pile, int maxOnATurn){ }
}

public class Main {
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Player p1;
		Player p2;
		TimidPlayer tp = new TimidPlayer("Wakko");
		CleverPlayer cp = new CleverPlayer("Guy");

		p1 = tp;
		tp = p1;
		p2 = cp;
		cp = tp;
		p2 = p1;
		cp = p2;
		
		Game game1 = new Game( new CleverPlayer("Tammy"), new TimidPlayer("Pat") );
		
		TimidPlayer t = game1.nextPlayer();
		Player next = game1.nextPlayer();

	}
}
